package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-05-26 10:23
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int score, sum = 0, avg;
        //外出循环
        for (int i = 1; i <= 3; i++) {
            //内层循环,循环累加当前班级的总分,累加求和的变量清零，还原成初始值
            sum=0;
            for (int j = 1; j <= 3; j++) {
                System.out.println("输入第" + i + "个班，第" + j + "个人的成绩");
                score = sc.nextInt();
                sum += score;
            }
            avg = sum / 3;
            System.out.println("总分：" + sum);
            System.out.println("平均分：" + avg);
        }

    }
}
